package org.lcb.demo.shiyan3.service.imp;

import org.lcb.demo.shiyan3.mapper.ProductMapper;
import org.lcb.demo.shiyan3.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Product;

import java.util.List;

@Service
public class ProductServiceImp implements ProductService {
    @Autowired
    ProductMapper productMapper;
    @Override
    public Product getProductById(int id) {
       return productMapper.selectProductById(id);

    }

    @Override
    public List<Product> getProductByCategoryId(int categoryId) {
        return productMapper.selectProductByCategoryId(categoryId);
    }

    @Override
    public List<Product> getProductList() {
        return productMapper.selectProductList();
    }
}
